home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!beachyhd.demon.co.uk
- From: Adam@beachyhd.demon.co.uk
- Newsgroups: comp.sys.amiga.programmer
- Subject: *SLOW* colour cycling.. :(
- Date: 09 Feb 96 21:23:36 GMT
- Organization: Beachy Head - UK
- Message-ID: <311c0fb8@beachyhd.demon.co.uk>
- X-NNTP-Posting-Host: beachyhd.demon.co.uk
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-GateSoftware: AmiGate 1.6 (13.11.95)
- MMDF-Warning: Parse error in original version of preceding line at relay-4.mail.demon.net
- X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!beachyhd.demon.co.uk
-
- Hi all,
-
- I'm trying to make some colour-cycling patterns for a screen saver. However,
- I'm having a few problems getting the cycling to work..
-
- I've opened a DBLPAL:Lores screen with 8 bitplanes, and drawn my 256-colour
- patterns on it. Now it comes to the cycline routines. I've set up 3 arrays of
- 256 ULONGS, each array containing all the values for the Red, Green and Blue
- parameters of SetRBG32() for the palette.
-
- Now to cycle I use the following code:
-
-
- void cycle_colours(void)
- {
- int currcycle,i;
-
- CyclePos = (CyclePos + 20) % Colours;
-
- currcycle = CyclePos;
-
- for (i=0; i<Colours; i++)
- {
-
- SetRGB32(&(Screen1->ViewPort),i,Red[currcycle],Green[currcycle],Blue[currcycle]);
-
- currcycle = (currcycle+1) % Colours;
- }
- }
-
-
- This does the job, *BUT*, it takes about half a second to do a single cycle!!
- This is absolutely unacceptable.. I want it cycling within 1/25th of a second
- at the absolute worst..
-
- Now I remember back from my coding days how to perform colour cycling, and it
- involves very little work.. I guess that the SetRGB() function performs a lot
- of extra functions than just poking numbers in to the copperlist.. Can anyone
- suggest a *SYSTEM* *LEGAL* way that I can perform this colour cycling at a
- decent speed?
-
- Thanks!
-
- .\dam. [Team AMIGA] //\ ad32@brighton.ac.uk \\/
-
-